package com.edu.exam.entity.classmanagement.administrative;


/**
 * 班级调整类型枚举
 * 定义班级调整的操作类型
 *
 * @author System
 * @version 1.0.0
 */
public enum AdjustmentType {

    MERGE("MERGE", "班级合并", 1),
    SPLIT("SPLIT", "班级拆分", 2),
    STUDENT_ADJUST("STUDENT_ADJUST", "学生调班", 3),
    TEACHER_CHANGE("TEACHER_CHANGE", "教师更换", 4),
    NAME_CHANGE("NAME_CHANGE", "名称变更", 5);

    private final String code;
    private final String description;
    private final int order;

    AdjustmentType(String code, String description, int order) {
        this.code = code;
        this.description = description;
        this.order = order;
    }

    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public int getOrder() {
        return order;
    }

    public static AdjustmentType fromCode(String code) {
        if (code == null || code.trim().isEmpty()) {
            return null;
        }

        for (AdjustmentType value : values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }
}